package kt.com.bilin.coin.ui.activity

import android.os.Bundle
import com.bilin.coin.R
import kotlinx.android.synthetic.main.activity_base_refresh.*
import kt.com.bilin.coin.bean.PageBean
import kt.com.bilin.coin.helper.RefreshHelper
import kt.com.bilin.coin.ui.adapter.BaseRecyclerAdapter

/**
 * 在initview中初始化适配器
 */
abstract class BaseRefreshActivity<T> : BaseActivity(R.layout.activity_base_refresh) {
    protected lateinit var mRefreshHelper: RefreshHelper<T, MutableList<T>>
    protected lateinit var mBaseRecyclerAdapter: BaseRecyclerAdapter<*, T>

    override fun initView() {
        mRefreshHelper = RefreshHelper(refreshLayout, recyclerView, mBaseRecyclerAdapter) { onReload() }
    }

    override fun initData() {
        onReload()
    }

    abstract fun onReload()
}